package com.coder520.mamabike.common;

/**
 * Created by ASUS on 2017/8/12.
 */
public class Const {

    public static final String CURRENT_USER = "user_token";

    public static final String SYSTEM_VERSION = "version";

    public interface Role{
        String BIEK_CLIENT = "bike_client";
        String ROLE_NONE = "role_none";
        String ROLE_SOME = "role_some";
    }

    public interface Queue{
        String SMS_QUEUE = "sms.queue";
    }

    public enum SMSStatus{
        ILLAGEL_IP(3,"非法ip"),
        ILLAGEL_PHONE(4,"超过当日验证码发送上限"),
        MORE_TIME_AGAIN(2,"请稍后尝试"),
        SUCCESS(1,"校验通过");
        private int code;

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        private String desc;

        SMSStatus(int code, String desc){
            this.code = code;
            this.desc = desc;
        }
        public static SMSStatus codeOf(int code){
            for(SMSStatus  smsStatus: values()){
                if(smsStatus.getCode()==code){
                    return smsStatus;
                }
            }
            return null;
        }
    }

    public interface SMSType{
        String REGIST = "regist";
    }


    public enum SecurityCode {
        NEED_HEIGHT_VERSION(400,"需要升级版本"),
        NEED_LOGIN(401,"需要登录");

        private int code;

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        private String desc;

        SecurityCode(int code, String desc) {
            this.code = code;
            this.desc = desc;
        }
        public static SecurityCode codeOf(int code){
            for(SecurityCode securityCode : values()){
                if(securityCode.getCode()==code){
                    return securityCode;
                }
            }
            return null;
        }
    }
}
